﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NasuTek.Shion.Extencibility;

namespace Shion.SystemInformationPlugin
{
    public class Plugin : IPlugin
    {
        #region IPlugin Members

        public void Load(ExtencibilityManager e)
        {
            e.Plugins.Add("System Info", new ExtencibilityManager.PluginData("System Information Script",
                "(C) 2009 NasuTek Systems",
                "NasuTek Systems",
                "Writes to the active channel your system information",
                GetType().Assembly.GetName().Version));

            e.Aliases.Add("sysinfo", new SystemInfo());
        }

        #endregion
    }

    public class SystemInfo : Alias
    {
        #region Alias Members

        public void Execute(string[] args, Dictionary<string, string> vars, ExtencibilityManager ex)
        {
            ex.Clients[vars["em.activeServer"]].SendMessage(NasuTek.Shion.Agent.SendType.Message, vars["em.activeChannel"], SystemData.GetSystemInformation());
        }

        #endregion
    }

}
